package com.xjust.controller.inspection;

import com.xjust.pojo.Register;
import com.xjust.pojo.Result;
import com.xjust.pojo.ResultBean;
import com.xjust.service.InspectionRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@RestController
@RequestMapping("/inspectionRequests")
public class InspectionRequestController {
    @Autowired
    InspectionRequestService inspectionRequestService;
    //保存检验申请表
    @PostMapping("/saveInspectionRequest")
    public Result saveInspectionRequest(@RequestBody Map<String,Object> inspectionRequest){
        inspectionRequestService.saveInspectionRequest(inspectionRequest);
        return Result.success();
    }

    //检验申请：检验管理
    @GetMapping("/getInspectionRequests")
    public Result getInspectionRequests(Integer page,Integer pageSize,String realName,String caseNumber){
        ResultBean list = inspectionRequestService.getInspectionRequests(page,pageSize,realName,caseNumber);
        return Result.success(list);
    }
    //获取已完成患者数量
    @GetMapping("/getFinishInspectionList")
    public Result getFinishInspectionList(){
        Integer count = inspectionRequestService.getFinishInspectionList();
        return Result.success(count);
    }
    //获取等待患者数量
    @GetMapping("/getWaitInspectionList")
    public Result getWaitInspectionList(){
        Integer count = inspectionRequestService.getWaitInspectionList();
        return Result.success(count);
    }
    //录入患者检验信息
    @PutMapping("/submitCheckRequest")
    public Result submitinspectionRequest(Integer employeeId,Integer registId,Integer medicalTechnology){
        inspectionRequestService.submitInspectionRequest(employeeId,registId,medicalTechnology);
        return Result.success();
    }

}
